{	Problem: http://codeforces.ru/problemset/problem/12/A
	Verdict: Accepted

}
var a:array[1..3,1..3] of char; i,j:byte;
begin
for i:=1 to 3 do begin
    for j:=1 to 3 do read(a[i][j]);
    readln;
end;
if (a[1][1]=a[3][3]) and (a[1][2]=a[3][2]) and (a[1][3]=a[3][1]) and (a[2][1]=a[2][3]) then write('YES') else write('NO');
end.